//
//  YZENetwork.h
//  YZENetwork
//
//  Created by zjs on 17/3/14.
//  Copyright © 2017年 YZE. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import "NetworkDelegate.h"

//成功
#define SUCCESS_CODE 0


typedef void(^SuccessBlock)(id responseObject);

@interface YZENetwork : NSObject



/**
 打印返回property,默认NO
 */
@property (nonatomic , assign) BOOL isShowPropertyCode;

/**
 是否显示参数日志,默认NO
 */
@property (nonatomic , assign) BOOL isShowLog;

/**
 设置请求头部信息
 */
@property(nonatomic,strong) NSMutableDictionary *dicHTTPHeaderField;

+(instancetype)sharedInstace;

/**
 post
 
 @param url url
 @param parameters 请求参数
 @param delegate delegate
 @param tag 请求tag
 @param successBlock 成功回调
 */
-(void)postRequestWithUrl:(NSString*)url parameters:(id)parameters delegate:(id)delegate requestTag:(int)tag successBlock:(SuccessBlock)successBlock;


-(void)postRequestRegisterWithUrl:(NSString*)url parameters:(id)parameters delegate:(id)delegate requestTag:(int)tag successBlock:(SuccessBlock)successBlock;


/**
 get请求
 
 @param url <#url description#>
 @param parameters <#parameters description#>
 @param delegate <#delegate description#>
 @param tag <#tag description#>
 @param successBlock <#successBlock description#>
 */
-(void)getRequestWithUrl:(NSString*)url parameters:(id)parameters delegate:(id)delegate requestTag:(int)tag successBlock:(SuccessBlock)successBlock;

/**
 PUT
 
 @param url url
 @param parameters 请求参数
 @param delegate delegate
 @param tag 请求tag
 @param successBlock 成功回调
 */
-(void)putRequestWithUrl:(NSString*)url parameters:(id)parameters delegate:(id)delegate requestTag:(int)tag successBlock:(SuccessBlock)successBlock;

/**
 DELETE
 
 @param url url
 @param parameters 请求参数
 @param delegate delegate
 @param tag 请求tag
 @param successBlock 成功回调
 */
-(void)deleteRequestWithUrl:(NSString*)url parameters:(id)parameters delegate:(id)delegate requestTag:(int)tag successBlock:(SuccessBlock)successBlock;

/**
 取消所有网络请求
 */
-(void)cancelNetwork;
@end
